<div class="managedfunds view">
<h2><?php  echo __('View Fund'); ?></h2>
<dl>
<?php date_default_timezone_set('Australia/Victoria');

$info = getdate();
$date = $info['mday'];
$month = $info['mon'];
$year = $info['year'];
$hour = $info['hours'];
$min = $info['minutes'];
$sec = $info['seconds'];

$current_date = "$date/$month/$year"; ?>

<table>

	<tr>
		<th><?php echo __('Fund Name'); ?></th>
		<td>
			<?php echo h($managedfund['Managedfund']['FundName']); ?>
			&nbsp;
		</td>
	</tr>
	
	<tr>
		<th><?php echo __('APIR Code'); ?></th>
		<td>
			<?php echo h($managedfund['Managedfund']['APIRCode']); ?>
			&nbsp;
		</td>
	</tr>
	<tr>
		<th><?php echo __('Date'); ?></th>
		<td>
			<?php echo h($managedfund['Managedfund']['Date']); ?>
			&nbsp;
		</td>
	</tr>
	</table>
</dl>


<table border="0.5">
<tr>
    <th colspan="2">Monthly Returns </th>
    <th colspan="2">Yearly Returns </th>
    <th>Since Inception Return </th>
  </tr>

<tr>
	<td>1 month</td>
	<td><?php echo h($managedfund['Managedfund']['OneMonthReturn']); ?> &nbsp;</td>
	<td>1 year</td>
	<td><?php echo h($managedfund['Managedfund']['OneYearReturn']); ?> &nbsp;</td>
	<td><?php echo h($managedfund['Managedfund']['SinceInceptionReturn']); ?> &nbsp;</td>
</tr>

<tr>
	<td>3 month</td>
	<td><?php echo h($managedfund['Managedfund']['ThreeMonthReturn']); ?> &nbsp;</td>
	<td>2 years</td>
	<td><?php echo h($managedfund['Managedfund']['TwoYearReturn']); ?> &nbsp;</td>
</tr>


<tr>
	<td>6 month</td>
	<td><?php echo h($managedfund['Managedfund']['SixMonthReturn']); ?> &nbsp;</td>
	<td>3 years</td>
	<td><?php echo h($managedfund['Managedfund']['ThreeYearReturn']); ?> &nbsp;</td>
</tr>

<tr>
	<td></td>
	<td></td>
	<td>4 years</td>
	<td><?php echo h($managedfund['Managedfund']['FourYearReturn']); ?> &nbsp;</td>
</tr>

<tr>
	<td></td>
	<td></td>
	<td>5 years</td>
	<td><?php echo h($managedfund['Managedfund']['FiveYearReturn']); ?> &nbsp;</td>
</tr>
</table>
</dl>

<table cellpadding="0" cellspacing="0">
	<tr>
		<th>Date</th>
		<th>1 Month</th>
		<th>3 Month</th>
		<th>6 Month</th>
		<th>1 Year</th>
		<th>2 Year</th>
		<th>3 Year</th>
		<th>4 Year</th>
		<th>5 Year</th>
		<th>Since Inception</th>
		<th></th>
	</tr>
	<?php
		$recordTotal=$this->Session->read("recordTotal");
		$recordPer=$this->Session->read("recordPer");
		echo "<h3>Displaying last 10 monthly records:</h3><h4>(".$recordTotal." records in total)</h4>";
		echo "<br>";
		for($n=0;$n<$recordTotal;$n++)
		{?>
			<tr><?php
			for($m=1;$m<$recordPer;$m++)
			{?>
				<td><?php echo $this->Session->read("record[".$n."][".$m."]") ?></td><?php
			}?>
			<td class="myButtons">
						<?php 

							echo "<a href=/DFS/managedfunds/view/".$this->Session->read("record[".$n."][0]")."><img src=/DFS/img/view-btn.jpg alt=View></a>";

						?>
			</tr><?php
		}
	?>
</table>
</div>